<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>外边距</title>
    <style type="text/css">
        .main {
            width: 1200px;
            margin:10px auto;
            background: blue;
        }

        .main div{
            width: 200px;
            height: 200px;
            background: deeppink;
            color:#fff;
            margin-bottom: 50px;
        }
        .main p{
            width: 200px;
            height: 200px;
            background: green;
            color:#fff;
            margin-top: 80px;
        }
    </style>
</head>
<body>
<div class="main">
    <div>
        这是上面的div
    </div>
    <p>
        这是下面的p
    </p>
</div>
</body>
</html>